@echo off

:: 定义仓库路径和远程仓库 URL
set SOURCE_DIR=my-blog-source
set WEBSITE_DIR=my-blog-website
set SOURCE_REPO_URL=git@atomgit.com:fenju/my-blog-source.git
set WEBSITE_REPO_URL=git@atomgit.com:fenju/my-blog-website.git

:: Configure Git user identity
@REM git config --global user.email "你自己的邮箱"
@REM git config --global user.name "你自己的用户名"

:: 构建 Hugo 站点
cd %SOURCE_DIR%
hugo

:: 将源博客数据推送到远程仓库
git add .
git commit -m "Update blog source"
git push origin master

:: 将生成的文件添加到网站仓库并推送
cd ..\%WEBSITE_DIR%
git add .
git commit -m "Update blog content"
git push origin master

echo Blog source and website updated and pushed to AtomGit Pages.